
#ifndef _CTHREAD_SYNCHRONIZED_H_
#define _CTHREAD_SYNCHRONIZED_H_

#include "exception.h"
#include "monitor.h"

namespace CThread
{

class Synchronized 
{
public:

	Synchronized(Monitor& value) : monitor_(value) 
	{
		monitor_.lock();
	}

	~Synchronized() 
	{
		monitor_.unlock();
	}

private:
	Monitor& monitor_;
};


};

#endif // #ifndef _CTHREAD_MONITOR_H_
